#ifndef PROTOCOL_H
#define PROTOCOL_H

#include <QAbstractTableModel>
#include <QModelIndex>
#include <QModelIndexList>

struct ProtocolTableModel : public QAbstractTableModel {
    explicit ProtocolTableModel(QObject *parent = 0);
    virtual qint64 position(const QModelIndex& index) = 0;
    virtual QModelIndex locate(qint64 pos) = 0;
    virtual bool deleteRows(const QString& fileName, const QModelIndexList& rows) = 0;
    virtual bool deleteColumns(const QString& fileName, const QModelIndexList& cols) = 0;
    virtual bool saveRows(const QString& fileName, const QModelIndexList& rows) = 0;
    virtual bool saveColumns(const QString& fileName, const QModelIndexList& cols) = 0;
    virtual bool supportFilter(const QModelIndex& index) { Q_UNUSED(index); return false; }
    virtual void filter(const QModelIndex& index) { Q_UNUSED(index); }

signals:
    void openTempFile(const QString fileName);
};

QString jdString(int jd);
QString jsString(quint32 js);
QString ertString(quint32 js,quint16 ms);
QString bidString(quint32 bid);

#endif // PROTOCOL_H
